<%--
  Created by IntelliJ IDEA.
  User: fanyuting
  Date: 2017/3/10 0010
  Time: 上午 10:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="accessory" uri="http://accessoryPackageTag.weitu.net" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <style type="text/css">
        .menu-right{width: 230px;height: 30px;float:right;margin-top: 10px;margin-bottom: 10px;}
        .button {
            width: 54px;
            height: 28px;
            border: 1px solid #959595;
            border-radius: 5px;
            overflow: hidden;
            float: left;
            margin-right: 10px;
            cursor: pointer;
            background-repeat: no-repeat;
            background-position: 5px center;
            background-color: #b9e5f5;
            font-size: 14px;
            color: #202020;
            text-align: right;
            line-height: 28px;
            padding-right: 10px;
        }
        .icon-export {
            background-image: url("${ctx}/resources/themes/images/export_03.png");
        }
        .icon-save {
            background-image: url("${ctx}/resources/themes/images/save_03.png");
        }
        .icon-refer {
            background-image: url("${ctx}/resources/themes/images/refer_03.png");
        }
        .icon-save:hover, .icon-export:hover, .icon-refer:hover{
            font-size: 14px;
            color: #202020;
        }
        .information{width: 1130px;margin: 10px auto 0;clear: both;overflow: hidden}
        .information-title{width: 1130px;height:33px;background: url("${ctx}/resources/themes/images/title_bg_03.png") no-repeat;clear: both}
        .information-title p{color: #fff;line-height: 33px;font-size: 14px;margin-left: 20px;float: left}
        .information-title a{float: right;margin-top: 8px;margin-right: 10px;}
        .cuttle{width: 1115px;margin-top: 10px;clear: both;padding-left: 15px;}
        .form_one{float: left;margin-right: 60px;margin-bottom: 5px;}
        .form_two{float: left;margin-right: 28px;margin-bottom: 5px;}
        .form_one .product , .form_two .product{width: 240px;height: 27px;border:1px solid #959595;padding-left: 10px;color: #646262;font-size: 12px;margin-left: 5px;}
        .form_one .productA, .form_two .productA{width: 250px;height: 27px;border:1px solid #959595;padding-left: 10px;color: #646262;font-size: 12px;margin-left: 5px;}
        .form_two .lable-style{font-size: 12px;color: #181717;}
        .form_one span, .form_two span{color: #ea0404;font-size: 20px;}
        .form_two .lable-styleA{margin-left: 8px;}
        .form_two .lable-styleB{margin-left:19px;}
        .productB{width: 650px;height: 80px;border:1px solid #959595;padding-left: 10px;color: #646262;font-size: 12px;margin-left: 8px;}
        .form_two .lable-styleC{float: left}
        .enclosure{width: 1125px;margin-top: 10px;border:1px solid #959595;overflow: hidden}
        .upload{width: 68px;height: 30px;border: 1px solid #959595;background: #B6F0F0;margin: 10px;line-height: 30px;font-size: 12px;}
        .attachment{width: 1100px;clear: both;padding-left: 10px;}
        .attachment li{float: left;height: 20px;margin: 10px 10px;background: url("${ctx}/resources/themes/images/fj_03.png") no-repeat left ;background-size: 13px;}
        .attachment li img{float: left;}
        .attachment li p{float: left;font-size: 12px;color: #060606;margin-left: 15px;line-height: 20px;cursor:pointer;}
        .attachment li p:hover{
            color:#ff0033;
        }
        .attachment li p span{color: #4f5051;margin-left: 5px;}
        .attachment li a{float: left;margin-left: 10px;color: #1277eb;line-height: 20px}
        .remind{overflow: hidden;width: 440px;height: 38px;margin-left: 10px;clear: both;background: url("${ctx}/resources/themes/images/remind_03.png") no-repeat left top;}
        .remind img{float: left;margin-right: 10px;}
        .remind p{font-size: 12px;color: #111212;margin-left: 20px;}
        .remind p span{font-weight: bold;}
        .attachment-show{width: 1100px;border: 1px solid #BFBFBF;margin: 0 auto 10px;}
        .attachment-show td{text-align: center;padding: 5px 0}
        .tr-one{background:#BBE5F9}
        td{border-right: 1px solid #C9C9C9;border-bottom: 1px solid #C9C9C9;}
        tr .delate{color: #1277eb;cursor: pointer;}
    </style>
    <link rel="stylesheet" type="text/css" href="${pageContext.servletContext.contextPath }/resources/js/accessory/accessory-css/accessory.css">
    <SCRIPT src="${pageContext.servletContext.contextPath }/resources/jquery/jquery-1.11.3.min.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="${pageContext.servletContext.contextPath }/resources/js/accessory/jQuery-File-Upload-9.17.0/js/vendor/jquery.ui.widget.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="${pageContext.servletContext.contextPath }/resources/js/accessory/jQuery-File-Upload-9.17.0/js/jquery.iframe-transport.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="${pageContext.servletContext.contextPath }/resources/js/accessory/jQuery-File-Upload-9.17.0/js/jquery.fileupload.js" type="text/javascript"></SCRIPT>
    <SCRIPT src="${pageContext.servletContext.contextPath }/resources/js/accessory/accessory-js/accessory.js" type="text/javascript"></SCRIPT>
<style type="text/css">
/*    .accessory_div{
        text-align: center;
    }
    .accessory_selectBtn{
        color: #000;
    }*/
</style>
    <title>附件上传测试</title>
</head>
<body align="center" >
<form id="form" method="post">
    <%--
  businessId:业务Id。
  permission:write和readOnly两个值。显示详情页面时为readOnly，附件只允许下载；
        write时会根据是否是当前用户上传的附件判断是否有删除权限。
  packageKey:附件包的Key。
  uploadUserId:上传用户的Id，即当前用户。
  packageInfos:跳转到编辑、新增或显示详情页面时，
      要调用附件模块的接口查询附件信息，将查询出的对象放入该属性，
      标签会根据附件包的Key显示相应附件包下的附件信息。
   accessoryType:允许上传的附件类型，例：accessoryType = "txt,docx,jpg"
  --%>
    <accessory:accessory permission="write"  packageKey="${packageKey}" uploadUserId="${uploadUserId}"  packageInfos="${accessoryList}" accessoryType = "txt,docx,jpg"></accessory:accessory>

    <div align="center" style="width: 80%; margin-top: 10px;">
        <input align="center" type="button" onclick="submitForm();" value="提交表单">
    </div>

</form>




</body>
<script type="text/javascript">
    function submitForm(){
        $.ajax({
            url:"${pageContext.request.contextPath}/accessory/testForm.shtml",//提交地址
            data:$("#form").serialize(),//将表单数据序列化
            type:"POST",
            dataType:"json",
            success:function(result){
                if (result == 'success'){
                    alert("成功！");
                    window.location.reload();
                }else{
                    alert("失败！");
                }
            }
        });
    }


</script>
</html>
